<?php
namespace restphp\core;

/**
 * Class RestConstant
 * @author sofical
 * @date 2017-03-17
 * @package restphp\core
 */
class RestConstant {
    public static function REST_TARGET() {
        return defined('DIR_BUILD_TARGET') ? DIR_BUILD_TARGET : (DIR_RESTPHP . DIRECTORY_SEPARATOR . 'target');
    }

    public static function REST_URI_ALL_END() {
        return 'RESTPHPURIALLEND';
    }

    public static function REST_URI_SIGE_END() {
        return 'RESTPHPURISIGEEND';
    }

    const PATTERN_URI_PARAM = '([\x4e00-\x9fa50-9a-zA-Z\-]+)';

    public static function RE_FORMAT_URL($url) {
        $formatUrl = str_replace('\\x4e00', '\\x{4e00}', $url);
        return str_replace('\\x9fa5', '\\x{9fa5}', $formatUrl);
    }
}